<html>
<head><meta charset="utf-8"><title>Error annotation pattern · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html">Error annotation pattern</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213615863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213615863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213615863">(Oct 16 2020 at 21:23)</a>:</h4>
<p>When writing error annotations, like <code>//~ ERROR ...</code> is it possible to match a pattern instead of a specific string?</p>



<a name="213617550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213617550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213617550">(Oct 16 2020 at 21:41)</a>:</h4>
<p>I don't think so, but it does a prefix match, not an exact match, which may be enough for you.</p>



<a name="213617851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213617851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213617851">(Oct 16 2020 at 21:44)</a>:</h4>
<p>I can only match "the trait bound"</p>



<a name="213617865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213617865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213617865">(Oct 16 2020 at 21:45)</a>:</h4>
<p>and then there's a file path</p>



<a name="213617873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213617873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213617873">(Oct 16 2020 at 21:45)</a>:</h4>
<p>(and $DIR doesn't seem to work in the annotation itself)</p>



<a name="213618314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Error%20annotation%20pattern/near/213618314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Error.20annotation.20pattern.html#213618314">(Oct 16 2020 at 21:50)</a>:</h4>
<p>There is error-pattern (which is still only a substring match), but might be useful if you don't have file location to match on.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>